package com.enki.cigarettes.repository;

import com.enki.cigarettes.entity.UserSignInT;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Date;
import java.util.List;

/**
 * @author WCS.Wang
 * @version V1.0
 * @Package com.enki.cigarettes.repository
 * @Name e-cigarettes-shop-api-module
 * @Description: TODO 用户签到数据层
 * @date 2019-08-09
 */
public interface UserSignInTRepository extends PagingAndSortingRepository<UserSignInT, String> {

    // 根据用户ID、签到时间
    List<UserSignInT> findByUserTIdAndSignInTimeGreaterThanEqual(String userTId, Date signInTime, Sort sort);

    // 获取第一条数据
    UserSignInT findFirstByUserTId(String userTId);

    // 获取当天签到信息
    UserSignInT findFirstByUserTIdAndSignInTimeGreaterThanAndSignInTimeLessThan(String userTId, Date startTime, Date endTime);
}
